home *** CD-ROM | disk | FTP | other *** search
- /*
- This is the very simple client for revserv.rexx or pserv.rexx.
- */
-
- l="rexxsupport.library";if ~show("L",l) then;if ~addlib(l,0,-30) then do;say "can't find" l;exit;end
- l="rmh.library";if ~show("L",l) then;if ~addlib(l,0,-30) then do;say "can't find" l;exit;end
- l="rxsocket.library";if ~show("L",l) then;if ~addlib(l,0,-30) then do;say "can't find" l;exit;end
-
- prg = ProgramName("NOEXT")
-
- sin.ADDRFAMILY = "INET"
- sin.ADDRPORT = 4000
- sin.ADDRADDR = '127.0.0.1'
-
- sock = socket("INET","STREAM",0)
- if sock<0 then call err "no socket:" errno()
-
- if connect(sock,"SIN")<0 then call err "connect error:" errno()
-
- request = "reverse service test"
- say length(request)
- res = send(sock,request)
- if res~=length(request) then call err "send error:" errno()
-
- len = recv(sock,"BUF",256)
- if len<0 then call err "recv error:" errno()
-
- say buf
- say length(buf)
- exit
-
- err: procedure expose prg
- parse arg msg
- say prg":" msg
- exit
-
-